<?php
class pageFetcher {

    var $body = null;

    function set_page($curr_page) {
        $this->pageid = $curr_page;
        return $this->pageid;
    }

    function set_id($curr_id) {
        $this->id = $curr_id;
        return $this->id;
    }

    function get_title() {
        $connect = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
        $query = $connect->query("SELECT title FROM ".$prefix."pages WHERE pageid=".$this->pageid);
        $row = $query->fetch_object();
        $this->title = $row->title;
        return $this->title;
        $query->close();
        $connect->close();
    }

    function get_summary() {
        $connect = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
        $query = $connect->query("SELECT summary FROM ".$prefix."pages WHERE pageid=".$this->pageid);
        $row = $query->fetch_object();
        $this->summary = $row->summary;
        return $this->summary;
        $query->close();
        $connect->close();
    }

    function get_body() {
        $connect = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
        $query = $connect->query("SELECT body FROM ".$prefix."pages WHERE pageid=".$this->pageid);
        $row = $query->fetch_object();
        $this->body = $row->body;
        return $this->body;
        $query->close();
        $connect->close();
    }

    function get_feed() {
        $connect = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
        $query = $connect->query("SELECT feed FROM ".$prefix."pages WHERE pageid=".$this->pageid);
        $row = $query->fetch_object();
        $this->feed = $row->feed;
        return $this->feed;
        $query->close();
        $connect->close();
    }

    function get_hidden() {
        $connect = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
        $query = $connect->query("SELECT hidden FROM ".$prefix."menu WHERE id=".$this->pageid);
        $row = $query->fetch_object();
        if($row->hidden == '0') {
            $this->checked = "checked";
        }
        elseif($row->hidden == '1') {
            $this->checked = "";
        }
        return $this->checked;
        $query->close();
        $connect->close();
    }
}
?>
